//
//  BaseViewController.m
//  CXDToolKit
//
//  Created by 陈小东 on 15/3/4.
//  Copyright (c) 2015年 ___cxd___. All rights reserved.
//

#import "BaseViewController.h"
#import "UtilsMacro.h"

@implementation BaseViewController
- (void)viewDidLoad{
    [super viewDidLoad];
    if(kIOS7){
        self.edgesForExtendedLayout = UIRectEdgeNone;
        [self setAutomaticallyAdjustsScrollViewInsets:NO];//导航栏上放scrollView使得内容不自动调整
    }
    self.view.backgroundColor = [UIColor whiteColor];
    [self createViews];
}

- (void)initLeftNavgationController:(BOOL)left{ // 如果present需要设置 self.isPersent = YES;
    if(left){
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:nil style:UIBarButtonItemStylePlain target:self action:@selector(didBack)];
    }
}

- (void)createViews{
    
}

- (void)didBack{
    if(self.isPersent){
        [self dismissViewControllerAnimated:YES completion:nil];
    }else{
        [self.navigationController popViewControllerAnimated:YES];
    }
}

@end
